package com.fanxuankai.boot.apollo.openapi.autoconfigure;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 发布相关配置
 *
 * @author fanxuankai
 */
@ConfigurationProperties(prefix = ApolloConfigPublishProperties.PREFIX)
public class ApolloConfigPublishProperties {
    public static final String PREFIX = ApolloOpenApiProperties.PREFIX + ".publish";
    public static final String ENABLED = PREFIX + ".enabled";

    /**
     * 开关
     */
    private boolean enabled;
    /**
     * 发布标题，必选，默认为当前时间(yyyyMMddHHmmss)-release
     * 在开启阿波罗配置发布的情况下，将该参数与最后一次发布的标题对比，如果标题不一致则发布，否则不发布
     */
    private String releaseTitle;
    /**
     * 发布注释，可选
     */
    private String releaseComment;
    /**
     * 发布人，必选
     */
    private String releasedBy = "apollo";
    /**
     * 是否紧急发布，必选，默认为 false
     */
    private boolean emergencyPublish;

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public String getReleaseTitle() {
        return releaseTitle;
    }

    public void setReleaseTitle(String releaseTitle) {
        this.releaseTitle = releaseTitle;
    }

    public String getReleaseComment() {
        return releaseComment;
    }

    public void setReleaseComment(String releaseComment) {
        this.releaseComment = releaseComment;
    }

    public String getReleasedBy() {
        return releasedBy;
    }

    public void setReleasedBy(String releasedBy) {
        this.releasedBy = releasedBy;
    }

    public boolean isEmergencyPublish() {
        return emergencyPublish;
    }

    public void setEmergencyPublish(boolean emergencyPublish) {
        this.emergencyPublish = emergencyPublish;
    }
}
